function [A,b,label] = get_lin_sys(fileName)
fid = fopen(fileName, 'r');
%import the matrix
tmp = fscanf(fid,'%d%d%d',3);
m = tmp(1);
n = tmp(2);
nnz = tmp(3);
I = zeros(nnz,1);
J = zeros(nnz,1);
S = zeros(nnz,1);
for i = 1:nnz
    c = fscanf(fid,'%d %d %f',3);
    I(i) = c(1)+1;
    J(i) = c(2)+1;
    S(i) = c(3);
end
A = sparse(I,J,S,m,n);
%import rhs
tmp = fscanf(fid,'%d',1);
b = zeros(m,1);
for i = 1:m
    b(i) = fscanf(fid,'%f',1);
end
% import label
tmp = fscanf(fid,'%d',1);
label = zeros(tmp,1);
for i = 1:tmp
    label(i) = fscanf(fid,'%d',1);
end
fclose(fid);